/**
 * 
 */
package com.ez.supervise.core;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author searph.wang
 * @email searph.wang@gmail.com
 * @Created at 2009-7-27
 * 
 */
@SuppressWarnings("unchecked")
public class Page {
    
    /** 总记录数 */
    private int totalProperty;
    
    /** 分页结果 */
    
    private List root;
    
    /** 开始页码 */
    private int start;
    
    /** 每页多少 */
    private int limit;
    
    /** 成功与否 */
    private boolean success = true;
    
    /** 查询条件 */
    private Map conditions = new HashMap();
    
    public int getLimit() {
    	return limit;
    }
    
    public void setLimit(int limit) {
    	this.limit = limit;
    }
    
    public List getRoot() {
    	return root;
    }
    
    public void setRoot(List root) {
    	this.root = root;
    }
    
    public int getStart() {
    	return start;
    }
    
    public void setStart(int start) {
    	this.start = start;
    }
    
    public boolean isSuccess() {
    	return success;
    }
    
    public void setSuccess(boolean success) {
    	this.success = success;
    }
    
    public int getTotalProperty() {
    	return totalProperty;
    }
    
    public void setTotalProperty(int totalProperty) {
    	this.totalProperty = totalProperty;
    }

    public void setConditions(Map conditions) {
	this.conditions = conditions;
    }

    public Map getConditions() {
	return conditions;
    }
    public void putCondition(String key, Object value){
	conditions.put(key, value);
    }
    public Object getCondition(String key){
	return conditions.get(key);
    }
    
    public void addPageInfo(){
	conditions.put("start", start);
	conditions.put("limit", limit);
    }
    
    public void removePageInfo(){
	conditions.remove("start");
	conditions.remove("limit");
    }
    
    
}

